import * as Types from '../action-types';
const wait = () => new Promise(resolve => setTimeout(resolve, 1000));
/**
 * vote派发行为对象管理
 * @type {{vote_up(): {type: string}, vote_down(): {type: string}}}
 */
export const VoteAction = {
      vote_up(){
        return async dispatch=> {
            await wait();
            dispatch({type:Types.VOTE_UP})
        }
    },
    async vote_down(){
          await wait();
        return {
            type:Types.VOTE_DOWN
        }
    }
}

export default VoteAction;